import {defineStore} from 'pinia'
import type{IGoods} from '@/types/types'
import { ref } from 'vue'

export const useDetailStore = defineStore('detail',{
    state(){
        return{
            detailPrice: ref(0),
        }
    },
    actions:{
        changePrice(goods:IGoods){
            this.detailPrice = goods.price
        },
        resetPrice(){
            this.detailPrice = 0;
        }
    },
    getters:{
        payPrice(){
            return this.detailPrice
        }
        
    },
    
})